<template>
  <!-- <el-row :gutter="30">
    <el-col :span="4"
            :class="tagClass">
      <span>
        {{ tagName }}
      </span>
    </el-col>
    <el-col :span="20"
            style="padding-left: 0">
      <ul>
        <li class="person0">
          <Tooltip v-if="iconName"
                   :content="content"
                   :placement="placement">
            <icon-svg class-name="iconClass mr5"
                      :icon-name="iconName" />
          </Tooltip>
          {{ name }}
        </li>
        <li class="person1">
          {{ address }}
        </li>
        <li class="person2">
          {{ contactName }}
          <span class="ml20 mr20">{{ contactMobile }}</span>
          <span v-for="(additional, index) in additionals"
                :key="index">
            {{ additional }}
          </span>
        </li>
      </ul>
    </el-col>
  </el-row> -->
  <dn-participant v-model="participant"
                  :icon-name="iconName"
                  :address="address"
                  :tag-class="tagClass"
                  :tag-name="tagName"
                  :content="content"
                  v-bind="$attrs" />
</template>

<script>
export default {
  name: "Participant",
  props: {
    value: Object,
    tagName: String,
    tagClass: String,
    iconName: String,
    content: String
  },
  computed: {
    participant () {
      return this.value || {};
    },
    address () {
      const province = this.participant?.province || "";
      const city = this.participant?.city || "";
      const district = this.participant?.district || "";
      const address = this.participant?.address || "";
      const fullAddress = province + city + district + address;
      return this.participant?.fullAddress || fullAddress;
    },
    name () {
      return this.participant?.name || "";
    },
    contactName () {
      return this.participant?.contactName;
    },
    contactMobile () {
      return this.participant?.contactMobile;
    },
    additionals () {
      return this.participant?.additionals || [];
    },
    placement () {
      return 'top'
    }
  },
  methods: {}
};
</script>

<style lang="scss" scoped>
.iconClass {
  width: 14px;
  height: 14px;
}
ul {
  padding: 0;
  list-style: none;
  li {
    margin-top: 10px;
  }
}
.from,
.to {
  margin-top: 12px;
  text-align: right;
  > span {
    display: inline-block;
    padding: 5px;
    height: 22px;
    text-align: center;
    width: 22px;
    border-radius: 50%;
    font-size: 16px;
    color: var(--prev-bg-white);
  }
}

.from > span {
  background-color: #2aa239;
}

.to > span {
  background-color: #e52914;
}

.person0 {
  font-size: 18px;
  font-weight: bold;
  line-height: 24px;
  word-break: break-all;
}
.person1 {
  font-size: 16px;
  line-height: 24px;
  word-break: break-all;
}
.person2 {
  font-size: 14px;
  color: var(--prev-color-text-silvergrey);
  line-height: 24px;
}
</style>
